package org.example.design.mediator.test1;

import java.awt.*;

/**
 * @author huangshen
 * @version 0
 * @description 表示按钮的类
 * @since 2022/2/11 10:21
 */
public class ColleagueButton extends Button implements Colleague {

    private Mediator mediator;

    public ColleagueButton(String caption) {
        super(caption);
    }

    /**
     * 传递仲裁者示例
     *
     * @param mediator 仲裁者
     */
    @Override
    public void setMediator(Mediator mediator) {
        this.mediator = mediator;
    }

    /**
     * 仲裁者下达的指示 启用为true 停用为false
     *
     * @param enabled 指示
     */
    @Override
    public void setColleagueEnabled(boolean enabled) {
        setEnabled(enabled);
    }
}
